import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder
import org.apache.spark.sql.Encoder
import spark.implicits._ 
case class Person(name: String, age: Long) 
val peopleDF = spark.sparkContext.
| textFile("file:////usr/local/bin/spark-2.4.4-bin-hadoop2.7/examples/src/main/resources/people.txt").
| map(_.split(",")).
| map(attributes => Person(attributes(0), attributes(1).trim.toInt)).toDF()
peopleDF.createOrReplaceTempView("people") 
val personsRDD = spark.sql("_______sql语句_______")
personsRDD.map(t => "Name: "+t(0)+ ","+"Age: "+t(1)).show() 